package com.cl.unipay4j.wx.pay;

import com.cl.unipay4j.core.IBaseEnum;

/**
 * @ClassName WxTradeTypeEnum
 * @Description 退款错误码
 * @Author Small
 * @Date 2019/11/29 15:53
 * @Version 1.0
 **/
public enum WxRefundErrorCodeEnum implements IBaseEnum<String> {
    /**
     * SYSTEMERROR
     */
    SYSTEMERROR("SYSTEMERROR", "接口返回错误", "系统超时等","请不要更换商户退款单号，请使用相同参数再次调用API",true),
    /**
     * BIZERR_NEED_RETRY
     */
    BIZERR_NEED_RETRY("BIZERR_NEED_RETRY", "退款业务流程错误，需要商户触发重试来解决","并发情况下，业务被拒绝，商户重试即可解决","请不要更换商户退款单号，请使用相同参数再次调用API。", true),
    /**
     * TRADE_OVERDUE
     */
    TRADE_OVERDUE("TRADE_OVERDUE", "订单已经超过退款期限","订单已经超过可退款的最大期限(支付后一年内可退款)","请选择其他方式自行退款", false),
    /**
     * ERROR
     */
    ERROR("ERROR", "业务错误","申请退款业务发生错误","该错误都会返回具体的错误原因，请根据实际返回做相应处理。", true),
    /**
     * USER_ACCOUNT_ABNORMAL
     */
    USER_ACCOUNT_ABNORMAL("USER_ACCOUNT_ABNORMAL", "退款请求失败","用户帐号注销","此状态代表退款申请失败，商户可自行处理退款。", false),
    /**
     * INVALID_REQ_TOO_MUCH
     */
    INVALID_REQ_TOO_MUCH("INVALID_REQ_TOO_MUCH", "无效请求过多","连续错误请求数过多被系统短暂屏蔽","请检查业务是否正常，确认业务正常后请在1分钟后再来重试", true),
    /**
     * NOTENOUGH
     */
    NOTENOUGH("NOTENOUGH", "余额不足","商户可用退款余额不足","此状态代表退款申请失败，商户可根据具体的错误提示做相应的处理。", true),
    /**
     * INVALID_TRANSACTIONID
     */
    INVALID_TRANSACTIONID("INVALID_TRANSACTIONID", "无效transaction_id","请求参数未按指引进行填写","请求参数错误，检查原交易号是否存在或发起支付交易接口返回失败", true),
    /**
     * PARAM_ERROR
     */
    PARAM_ERROR("PARAM_ERROR", "参数错误","请求参数未按指引进行填写","请求参数错误，请重新检查再调用退款申请", true),
    /**
     * APPID_NOT_EXIST
     */
    APPID_NOT_EXIST("APPID_NOT_EXIST", "APPID不存在","参数中缺少APPID","请检查APPID是否正确", true),
    /**
     * MCHID_NOT_EXIST
     */
    MCHID_NOT_EXIST("MCHID_NOT_EXIST", "MCHID不存在","参数中缺少MCHID","请检查MCHID是否正确", true),
    /**
     * ORDERNOTEXIST
     */
    ORDERNOTEXIST("ORDERNOTEXIST", "订单号不存在","缺少有效的订单号","请检查你的订单号是否正确且是否已支付，未支付的订单不能发起退款", true),
    /**
     * REQUIRE_POST_METHOD
     */
    REQUIRE_POST_METHOD("REQUIRE_POST_METHOD", "请使用post方法","未使用post传递参数 ","请检查请求参数是否通过post方法提交", true),
    /**
     * SIGNERROR
     */
    SIGNERROR("SIGNERROR", "签名错误","参数签名结果不正确","请检查签名参数和方法是否都符合签名算法要求", true),
    /**
     * XML_FORMAT_ERROR
     */
    XML_FORMAT_ERROR("XML_FORMAT_ERROR", "XML格式错误","XML格式错误","请检查XML参数格式是否正确", true),
    /**
     * FREQUENCY_LIMITED
     */
    FREQUENCY_LIMITED("FREQUENCY_LIMITED", "频率限制","2个月之前的订单申请退款有频率限制","该笔退款未受理，请降低频率后重试", true),
    /**
     * NOAUTH
     */
    NOAUTH("NOAUTH", "异常IP请求不予受理","请检查证书是否正确，证书是否过期或作废。","请检查证书是否正确，证书是否过期或作废。", true),
    /**
     * CERT_ERROR
     */
    CERT_ERROR("CERT_ERROR", "证书校验错误","商户可用退款余额不足","此状态代表退款申请失败，商户可根据具体的错误提示做相应的处理。", true),
    /**
     * REFUND_FEE_MISMATCH
     */
    REFUND_FEE_MISMATCH("REFUND_FEE_MISMATCH", "订单金额或退款金额与之前请求不一致，请核实后再试","订单金额或退款金额与之前请求不一致，请核实后再试","订单金额或退款金额与之前请求不一致，请核实后再试", true),
    /**
     * INVALID_REQUEST
     */
    INVALID_REQUEST("INVALID_REQUEST", "请求参数符合参数格式，但不符合业务规则","此状态代表退款申请失败，商户可根据具体的错误提示做相应的处理。","此状态代表退款申请失败，商户可根据具体的错误提示做相应的处理。", true),
    /**
     * ORDER_NOT_READY
     */
    ORDER_NOT_READY("ORDER_NOT_READY", "订单处理中，暂时无法退款，请稍后再试","订单处理中，暂时无法退款，请稍后再试  ","订单处理中，暂时无法退款，请稍后再试  ", true),
    ;
    private String value;
    private String desp;
    private String reason;
    private String solution;
    private boolean needReTry;


    WxRefundErrorCodeEnum(String value, String desp, String reason,String solution,boolean needReTry) {
        this.value = value;
        this.desp = desp;
        this.reason = reason;
        this.solution = solution;
        this.needReTry = needReTry;
    }

    @Override
    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    @Override
    public String getDesp() {
        return desp;
    }

    public void setDesp(String desp) {
        this.desp = desp;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public String getSolution() {
        return solution;
    }

    public void setSolution(String solution) {
        this.solution = solution;
    }

    public boolean isNeedReTry() {
        return needReTry;
    }

    public void setNeedReTry(boolean needReTry) {
        this.needReTry = needReTry;
    }
}
